<%-- 
    Document   : index.jsp
    Created on : 16.4.2009, 23:03:31
    Author     : Ediczech
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<f:view>
    <%@include file="view/header.jsp" %>

    <%-- Content --%>

    <h2><h:outputText value="#{msg.index_title}"/></h2>

    <a4j:form ajaxSubmit="true" reRender="bugTablePanel" id="bugTable" prependId="">
        <a4j:outputPanel ajaxRendered="true" id="bugTablePanel">
            <p>
                <h:panelGroup>
                    <h:outputText value="#{msg.bug_importance}: " />
                    <h:selectOneMenu id="Importance" value="#{BugTableBean.importanceId}">
                        <f:selectItems value="#{BugTableBean.importances}" />
                    </h:selectOneMenu>
                </h:panelGroup>
                &nbsp
                <h:panelGroup>
                    <h:outputText value="#{msg.bug_status}: " />
                    <h:selectOneMenu id="Status" value="#{BugTableBean.statusId}">
                        <f:selectItems value="#{BugTableBean.statuses}" />
                    </h:selectOneMenu>
                </h:panelGroup>
                &nbsp
                <h:commandButton action="#{BugTableBean.filter}" value="#{msg.filter_button}"/>
                </p>
            <rich:dataTable var="bug" value="#{BugTableBean.bugs}">
                <f:facet name="header">
                    <rich:columnGroup>
                        <rich:column><h:outputText value="#{msg.bug_id}" /></rich:column>
                        <rich:column><h:outputText value="#{msg.bug_title}" /></rich:column>
                        <rich:column><h:outputText value="#{msg.bug_project}" /></rich:column>
                        <rich:column><h:outputText value="#{msg.bug_importance}" /></rich:column>
                        <rich:column><h:outputText value="#{msg.bug_status}" /></rich:column>
                    </rich:columnGroup>
                </f:facet>

                <rich:column><h:outputText value="#{bug.id}" /></rich:column>
                <rich:column>
                    <h:outputLink value="/bugman-war/faces/bugDetail.jsp?id=#{bug.id}">
                        <h:outputText value="#{bug.title}" />
                    </h:outputLink>
                </rich:column>
                <rich:column><h:outputText value="#{bug.project.name}" /></rich:column>
                <rich:column><h:outputText value="#{bug.importance.name}" /></rich:column>
                <rich:column><h:outputText value="#{bug.status.name}" /></rich:column>
            </rich:dataTable>
        </a4j:outputPanel>
    </a4j:form>
    
    <%-- Content --%>

    <%@include file="view/footer.jsp" %>
</f:view>